import type { ValueAccessor } from "solid-form-context";
import type { Accessor, JSXElement } from "solid-js";

export interface FcListProps<V = any> extends ValueAccessor<V[]> {
    children: (accessor: Accessor<V>, index: number, ctx: FcListContext) => JSXElement
    onRef?: (ref: FcListContext<V>) => void
}

export interface FcListContext<V = any> {
    append: (value: V) => void
    appendAt: (value: V, index: number) => void
    removeAt: (index: number) => void
    clearAll: () => void
}
